import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import Layout from '@/views/layout.vue'
import Home from '@/views/home.vue'
import Classify from '@/views/classify.vue'
import ShoppingCart from '@/views/shopping-cart.vue'
import UserCenter from '@/views/user-center.vue'
import Login from '@/views/login.vue'
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/tabbar/home'
  },
  {
    path: '/tabbar',
    name: 'Layout',
    component: Layout,
    children: [
      {
        path: 'home',
        name: 'Home',
        component: Home
      },
      {
        path: 'classify',
        name: 'Classify',
        component: Classify
      },
      {
        path: 'shopping-cart',
        name: 'ShoppingCart',
        component: ShoppingCart
      },
      {
        path: 'user-center',
        name: 'UserCenter',
        component: UserCenter
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  }
]
const router = createRouter({
  history: createWebHistory(),
  routes
})
export default router
